package com.example.aigc_education.enums;

import lombok.Getter;

@Getter
public enum AnswerStatus {

    INIT("初始化", 0),
    RIGHT("正确", 1),
    WRONG("错误", 2),
    FORGET("忘记", 3);

    private final String title;

    private final int value;

    AnswerStatus(String title, int value) {
        this.title = title;
        this.value = value;
    }

    public static AnswerStatus fromValue(int value) {
        for (AnswerStatus answerStatus : AnswerStatus.values()) {
            if (answerStatus.getValue() == value) {
                return answerStatus;
            }
        }
        throw new IllegalArgumentException("No enum constant with value " + value);
    }
}
